home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / stabilzr.sit / The Stabilizer / stack_-1.xml < prev    next >
Extensible Markup Language  |  1989-02-05  |  20KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>34</cardCount>
  7.     <cardID>9877</cardID>
  8.     <listID>18180</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>--Copyright ┬⌐1988 - Scott McGilliard - all rights reserved--Thank you to: Andrew Gilmartin (Brown University) for XFCN PopUpMenuon openStackglobal saveMsghide msghide menuBarput loc of msg into saveMsgpush card "Expenses"get card field "allExpenses" of card "whichMonths"if it = empty then exit openStackget the dateconvert it to secondsif it >= line 2 of card field "startMonth" of┬¼card "Year Totals" thenanswer "It's time to recalculate, do it now?" with "No" or "Yes"if it is "Yes" thenput last word of the long date into whichYearif word 1 of item 2 of the long date Γëá "January" then put " -" &&┬¼whichYear + 1 after whichYearset loc of msg to 19,106put "Estimating expenses for" && whichYear & ", please wait."get line 2 of card field "startMonth" of card "Year Totals"convert it to long dateadd 1 to last item of itconvert it to secondsput it into line 2 of card field "startMonth" of┬¼card "Year Totals"doEstimatedoMathhide msgend ifend ifend openStackon idleglobal moreExpensesif moreExpenses = 1 then addExpenseset cursor to 5pass idleend idleon helpIndexvisual venetian blinds to grayvisual venetian blindsgo card "HelpIndex"end helpIndexon addExpenseglobal expenseAmount,expense,moreExpensespush cardGet card field "allExpenses" of card "whichMonths"if the number of lines of it >= 48 thenanswer "You can not enter more than 48 items" with "OK"get field expense3 of card "Expenses"if line 16 of it = empty then noMoreput empty into moreExpensesexit addExpenseend ifset numberFormat to "0.00"repeat foreverask "Please enter an expense item"repeatif "," is in it thenput offset (",",it) into erdelete char er of itelseexit repeatend ifend repeatput it into expenseItemif expenseItem = empty then exit repeatif the length of expenseItem > 18 thenanswer "Expense items can have only 18 characters" with "OK"exit addExpenseend ifput expenseItem&"," into expenseanswer "Do you pay the same amount every time?" with "No" or "Yes"if it is "yes" thenrepeat foreverask "Please enter the amount for"&&expenseItemif it is empty thenanswer "Do you want to delete this expense?" with┬¼"Yes" or "No"if it is "yes" thenput empty into expenseexit repeatelsenext repeatend ifelseexit repeatend ifend repeatif expense = empty then next repeatput "$" into expenseAmountif char 1 of it = "$" then delete char 1 of itrepeatif "," is in it thenput offset (",",it) into erdelete char er of itelseexit repeatend ifend repeatadd 0 to itput it & "," after expenseAmountput expenseAmount after expenseanswer "Do you pay this expense every month?" with "No" or "Yes"elseput "variable," into expenseAmountput expenseAmount after expenseend ifif it is "yes" and expenseAmount Γëá "variable," thenput "Every┬áMonth" after expenseexit repeatelsevisual venetian blinds to grayvisual venetian blindsgo card "whichMonths"put empty into moreExpensesexit addExpenseend ifend repeatdoAlphabetanswer "Are you finished adding expenses?" with "Yes" or "No"if it = "yes" thenput the number of lines of card field "allExpenses"┬¼of card "whichMonths" into test1put the number of lines of field "expense" of card "Expenses"┬¼into test2add the number of lines of field "expense2" of card "Expenses"┬¼to test2add the number of lines of field "expense3" of card "Expenses"┬¼to test2if test2 < test1 thennoMoreelseput empty into moreExpensesend ifend ifend addExpenseon doAlphabetglobal expenseset cursor to 4set loc of msg to 19,106put "Please wait"if expense = empty thenhide msgexit doAlphabetend ifrepeat with x = 1 to the length of item 1 of expenseput the charToNum of char x of item 1 of expense into tempif temp >= 97 and temp <= 122 thenput temp - 32 into tempput the numToChar of temp into char x of item 1 of expenseend ifend repeatput card field "allExpenses" of card "whichMonths" into allExpensesif allExpenses = empty thenput expense into card field "allExpenses" of card "whichMonths"put empty into expensehide msgexit doAlphabetend ifput item 1 of expense into exput 1 into yput 1 into zrepeatif ex = item 1 of line y of allExpenses thenanswer "You can't enter the same expense item twice." with "OK"ask "Please enter a different name for" && exif it = ex or it = empty thenput empty into expensehide msgexit doAlphabetelserepeatif "," is in it thenput offset (",",it) into erdelete char er of itelseexit repeatend ifend repeatput it into exrepeatif the length of ex > 18 thendelete last char of exelseexit repeatend ifend repeatrepeat with x = 1 to the length of exput the charToNum of char x of ex into tempif temp >= 97 and temp <= 122 thenput temp - 32 into tempput the numToChar of temp into char x of exend ifend repeatput ex into item 1 of expenseput 1 into yput 1 into zend ifend ifif line y of allExpenses = empty thenput return & expense after last line of card field "allExpenses"┬¼of card "whichMonths"put empty into expensehide msgexit doAlphabetend ifif the charToNum of char z of ex = the charToNum of char z┬¼of item 1 of line y of allExpenses thenadd 1 to zif char z of item 1 of line y of allExpenses = empty thenadd 1 to yput 1 into znext repeatend ifif char z of ex = empty thenput expense & return before line y of card field "allExpenses"┬¼of card "whichMonths"put empty into expensehide msgexit doAlphabetend ifnext repeatend ifif the charToNum of char z of ex < the charToNum of char z┬¼of item 1 of line y of allExpenses thenput expense & return before line y of card field "allExpenses"┬¼of card "whichMonths"put empty into expensehide msgexit doAlphabetelseadd 1 to yput "1" into znext repeatend ifend repeathide msgend doAlphabeton noMoreglobal moreExpensesset loc of msg to 19,106put "This will take a couple of minutes, please wait."put empty into moreExpensesset cursor to 4set lockScreen to trueput card field "allExpenses" of card "whichMonths" into allExpensesrepeat with x = 2 to 13put empty into field expense of card xput empty into field amount of card xput empty into field expense2 of card xput empty into field amount2 of card xend repeatput empty into field expense of card "Expenses"put empty into field expense2 of card "Expenses"put empty into field expense3 of card "Expenses"repeat with i = 1 to the number of lines in allExpensesput item 1 of line i of allExpenses into expenseNameput expenseName & return after field expense of card "Expenses"if item 3 of line i of allExpenses = "Every Month" thenrepeat with x = 2 to 13put expenseName & return after field expense of card xput item 2 of line i of allExpenses & return after field amount┬¼of card xend repeatelseif item 2 of line i of allExpenses = "Variable" thenrepeat with x = 3 to the number of items in┬¼line i of allExpensesput word 1 of item x of line i of allExpenses into whichput expenseName & return after field expense of card whichput last word of item x of line i of allExpenses & return┬¼after field amount of card whichend repeatelserepeat with x = 3 to the number of items in┬¼line i of allExpensesput item x of line i of allExpenses into whichput expenseName & return after field expense of card whichput item 2 of line i of allExpenses & return after field┬¼amount of card whichend repeatend ifend ifend repeatrepeat with x = 2 to 13put line 16 to 30 of field expense of card x into field expense2┬¼of card xdelete line 16 to 30 of field expense of card xput line 16 to 30 of field amount of card x into field amount2┬¼of card xdelete line 16 to 30 of field amount of card xend repeatput line 17 to 32 of field expense of card "Expenses" into field expense2┬¼of card "Expenses"put line 33 to 48 of field expense of card "Expenses" into field expense3┬¼of card "Expenses"delete line 17 to 48 of field expense of card "Expenses"hide msgend noMoreon seeItemsput card field "allExpenses" of card "whichMonths" into allExpensesput (item 2 of the clickLoc - 39) div 16 into whichLineput the short name of the target into whichFieldif line whichLine of field whichField is empty then exit seeItemsget line whichLine of field whichFieldrepeat with i = 1 to the number of lines in allExpensesif it = item 1 of line i of allExpenses thenput line i of allExpenses into theListexit repeatend ifend repeatif item 3 of theList = "Every Month" then put "," & card┬¼field "monthList" of card "Expenses" after theListput the mouseloc into listHereput item 1 of listHere + 1 into horizput item 2 of listHere - 10 into vertget the number of items in theListput vert + (it * 17) into lengthif length > 314 then subtract (length - 324) from vertget PopUpMenu(theList, 1, vert, horiz)put item it of theList into whatCardif it = 1 thenvisual barn door close slowly to grayvisual barn door open slowlygo card whatCardif the result Γëá empty thenrepeatanswer "Automatic cost adjustment for this expense?" with "Help"┬¼or "Yes" or "No"if it = "Help" thenpush cardvisual venetian blindsgo card itshow card field "Cost"repeat until the mouse is downend repeatvisual venetian blindspop cardelseexit repeatend ifend repeatif it = "Yes" thengo card "template"doMenu "New Card"put item 1 of theList into billset name of this card to billput "," & bill after line 3 of card field "startMonth" of card┬¼"Year Totals"repeat with y = 1 to the number of fieldsput field y of card "template" into field y of card billend repeatput bill into field "title" of card billput field "months" of card bill into tempMonset numberFormat to "0.00"if item 3 of theList = "Every Month" thenset numberFormat to "0"ask "Enter amount for"&& bill && "in" && last item┬¼of the long date - 1 with item 2 of theListset numberFormat to "0.00"repeatif "," is in it thenput offset (",",it) into erdelete char er of itelseexit repeatend ifend repeatif it = empty then put item 2 of the list into itif char 1 of it = "$" then delete char 1 of itadd 0 to itput "$" before itrepeat with y = 1 to 12put item 2 of theList into line y of actput it into line y of amoend repeatelseif item 2 of theList = "variable" thenput theList into oldListrepeat with i = 3 to the number of items in theListask "Enter amount for 1 yr before last" && word 1 of┬¼item i of theList with last word of item i of theListrepeatif "," is in it thenput offset (",",it) into erdelete char er of itelseexit repeatend ifend repeatif it = empty then put last word of item i of┬¼theList into itif char 1 of it = "$" then delete char 1 of itadd 0 to itput "$" before itrepeat with x = 1 to 12if word 1 of item i of theList = line x of┬¼tempMon then exit repeatend repeatput last word of item i of theList into line x of actput it into line x of amoend repeatelseput theList into oldListset numberFormat to "0"ask "Enter amount for"&& bill && "in" && last item┬¼of the long date - 1 with item 2 of theListrepeatif "," is in it thenput offset (",",it) into erdelete char er of itelseexit repeatend ifend repeatset numberFormat to "0.00"if it = empty then put item 2 of the list into itif char 1 of it = "$" then delete char 1 of itadd 0 to itput "$" before itrepeat with i = 3 to the number of items in theListrepeat with x = 1 to 12if word 1 of item i of theList = line x of┬¼tempMon then exit repeatend repeatput item 2 of theList into line x of actput it into line x of amoend repeatend ifset cursor to 4end ifput act into field "actual" of card billput amo into field "amount" of card billput "0" into totalActput "0" into totalAmorepeat with y = 1 to 12delete char 1 of line y of actdelete char 1 of line y of amoadd line y of act to totalActadd line y of amo to totalAmoend repeatset numberFormat to "0.0"put ((totalAct - totalAmo)/totalAmo)*100 into incif inc < 0 then put 0 into incput inc & "%" into line 2 of field "increase" of card billset numberFormat to "0.00"repeat with y = 1 to 12if line y of act Γëá empty thenput "$" & line y of amo + (line y of amo * inc/100) into┬¼line y of proput "$" & line y of amo - (line y of amo * inc/100) into┬¼line y of basend ifend repeatput pro into field "projected" of card billput bas into field "base" of card billif item 2 of theList = "Variable" thenget word 1 of item 2 of the long daterepeat with i = 1 to 12if it = line i of tempMon then exit repeatend repeatput i into trepeat with i = i to 12put line i of field "actual" of card bill into line i of┬¼field "amount" of card billput line i of field "amount" of card bill into line i of┬¼field "base" of card billif line i of act Γëá empty thenput "$" & line i of act + (line i of act * inc/100) into┬¼line i of field "projected" of card billput "$" & line i of act - (line i of act * inc/100) into┬¼line i of field "base" of card billend ifput empty into line i of field "actual" of card billend repeatrepeatanswer "Estimate" && bill && "and recalculate?" with "Help"┬¼or "Yes" or "No"if it = "Help" thenpush cardvisual venetian blindsgo card itshow card field "Estimate"repeat until the mouse is downend repeatvisual venetian blindspop cardelseexit repeatend ifend repeatif it is "Yes" thenset loc of msg to 19,106put "Estimating expense, please wait."repeat with t = t to 12get line t of field "amount" of card billif it Γëá empty thenput line t of field "projected" of card bill into proAmput proAm into line t of field "actual" of card billput line t of tempMon into┬¼whichMonthrepeat with s = 1 to the number of items in theListif whichMonth is in item s of theList then exit repeatend repeatput proAm into last word of item s of theListrepeat with y = 1 to 3if bill is in field y of card whichMonth thenrepeat with i = 1 to the number of lines in field y┬¼of card whichMonthif bill = line i of field y of card┬¼whichMonth thenput proAm into line i of field (y + 1) of┬¼card whichMonthexit repeatend ifend repeatexit repeatend ifend repeatrepeat with i = 1 to the number of lines in allExpensesif bill = item 1 of line i of allExpenses thenput theList into line i of card field "allExpenses"┬¼of card "whichMonths"exit repeatend ifend repeatend ifend repeatdoMathend ifend ifend ifend ifelseif whatCard = "Every Month" thenanswer "You can't go to every month at once." with "OK"exit seeItemselseput word 1 of whatCard into whatCardend ifvisual barn door close slowly to grayvisual barn door open slowlygo card whatCardend ifend seeItemson doEstimateset cursor to 4put last word of the long date into whichYearif word 1 of item 2 of the long date Γëá "January" then put " -" &&┬¼whichYear + 1 after whichYearput whichYear into field "thisYear1" of card "template"put whichYear into field "thisYear2" of card "template"put "SUMMARY FOR" && whichYear into card field "title"┬¼of card "Year Totals"if whichYear = last word of the long date thenput whichYear - 1 into field "lastYear" of card "template"elsesubtract 1 from first word of whichYearsubtract 1 from last word of whichYearput whichYear into field "lastYear" of card "template"end ifput card field "allExpenses" of card "whichMonths" into allExpensesput line 3 of card field "startMonth" of card "Year Totals" into┬¼whichBillput field "months" of card "template" into tempMonrepeat with i = 2 to the number of items in whichBillput item i of whichBill into billrepeat with x = 1 to the number of lines in allExpensesif bill = item 1 of line x of allExpenses thenput line x of allExpenses into theListexit repeatend ifend repeatput field "thisYear1" of card "template" into field "thisYear1"┬¼of card billput field "thisYear2" of card "template" into field "thisYear2"┬¼of card billput field "lastYear" of card "template" into field "lastYear"┬¼of card billput field "amount" of card bill into amoput field "actual" of card bill into actput field "projected" of card bill into prorepeat with y = 1 to 12if line y of amo Γëá empty and line y of act = empty then put┬¼line y of pro into line y of actend repeatif item 2 of theList Γëá "Variable" thenrepeat with y = 1 to 12if line y of act Γëá empty thenput line y of act into testexit repeatend ifend repeatrepeat with y = 1 to 12if line y of act Γëá empty and line y of act Γëá┬¼test then exit repeatend repeatrepeat with z = y to 12if line z of amo Γëá empty then put test into line z of amoend repeatput amo into field "base" of card billput act into field "amount" of card billrepeat with z = 1 to y - 1if line z of act Γëá empty thenput line y of act into line z of actput line y of act into line z of field "projected"┬¼of card billend ifend repeatput line y of act into test2delete char 1 of testdelete char 1 of test2set numberFormat to "0.0"put ((test2 - test)/test)*100 into incif inc < 0 then put 0 into incput inc & "%" into line 2 of field "increase" of card billset numberFormat to "0.00"repeat with z = y to 12if line z of amo Γëá empty thendelete char 1 of line z of actput "$" & line z of act + (line z of act * inc/100) into┬¼line z of field "projected" of card billput "$" & line z of act + (line z of act * inc/100) into┬¼item 2 of theListend ifput empty into line z of actend repeatput act into field "actual" of card billelseput amo into field "base" of card billput act into field "amount" of card billput empty into field "actual" of card billput "0" into totalActput "0" into totalAmorepeat with y = 1 to 12delete char 1 of line y of actdelete char 1 of line y of amoadd line y of act to totalActadd line y of amo to totalAmoend repeatset numberFormat to "0.0"put ((totalAct - totalAmo)/totalAmo)*100 into incif inc < 0 then put 0 into incput inc & "%" into line 2 of field "increase" of card billset numberFormat to "0.00"repeat with y = 1 to 12if line y of amo Γëá empty then put "$" & line y of┬¼act + (line y of act * inc/100) into line y of┬¼field "projected" of card billend repeatend ifrepeat with t = 1 to 12get line t of field "projected" of card billif it Γëá empty thenput it into proAmput line t of tempMon into whichMonthif item 2 of theList = "variable" thenrepeat with s = 1 to the number of items in theListif whichMonth is in item s of theList then exit repeatend repeatput proAm into last word of item s of theListend ifrepeat with y = 1 to 3if bill is in field y of card whichMonth thenrepeat with i = 1 to the number of lines in field y┬¼of card whichMonthif bill = line i of field y of card┬¼whichMonth thenput proAm into line i of field (y + 1) of┬¼card whichMonthexit repeatend ifend repeatexit repeatend ifend repeatrepeat with i = 1 to the number of lines in allExpensesif bill = item 1 of line i of allExpenses thenput theList into line i of card field "allExpenses"┬¼of card "whichMonths"exit repeatend ifend repeatend ifend repeatend repeatend doEstimateon doMathset cursor to 4set loc of msg to 19,106put "Calculating, please wait."set numberFormat to "0.00"put "0" into temp4repeat with x = 2 to 13put "0" into temp2repeat with i = 1 to the number of lines in field 2 of card xput line i of field 2 of card x into temp1delete char 1 of temp1add temp1 to temp2end repeatrepeat with i = 1 to the number of lines in field 4 of card xput line i of field 4 of card x into temp1delete char 1 of temp1add temp1 to temp2end repeatput "$" & temp2 into field "subTotal" of card xput "$" & temp2 & return after temp3put temp2 & return after tempAmadd temp2 to temp4end repeatput temp3 into card field "amounts" of card "Year Totals"put "$" & temp4 into card field "Total" of card "Year Totals"put temp4 into